select ' INSERT INTO EMPLOYEE(BRANCHCODE,LASTNAME,FIRSTNAME,MIDDLEINITIAL,SSSNUMBER,TIN,PHNUMBER,PINUMBER,BIRTHDATE,GENDER,MARITALSTATUS,ADDRESS1,ADDRESS2,ZIPKEY,HOMEPHONE,WORKPHONE,CELLPHONE,STATUS,EMAIL,RELIGION,NATIONALITY,TITLE,NICKNAME,HIREDDATE,EOCDATE,POSITION,LEVEL,VL,SL,USL,username,password,DTREMPCODE,DTRLINKNAME,EMPSHIFTCODE,PICTURE,BASICMONTHLY,BASICDAILY,ALLOWANCE,SSSCON,PHCON,HDMFCON,COMMENTS,GASALLOWANCE,SSSDED,PHDED,HDMFDED,CADED,TAXDED,SSSLOANDED,HDMFLOANDED,COMPANYLOANDED,OTHERS,AUTOINCPAYROLL,DEPARTMENT,BRANCHNAME,SUPERIOR,ACCESSREGSYS) VALUES (' 
+ isnull(CAST(BRANCHCODE AS VARCHAR(4)),'Null')
+ ',''' + ISNULL(LASTNAME,'')
+ ''',''' + ISNULL(FIRSTNAME,'')
+ ''',''' + ISNULL(MIDDLEINITIAL,'')
+ ''',''' + ISNULL(SSSNUMBER,'')
+ ''',''' + ISNULL(TIN,'')
+ ''',''' + ISNULL(PHNUMBER,'')
+ ''',''' + ISNULL(PINUMBER,'')
+ ''',''' + isnull(convert(varchar(10),BIRTHDATE,126),'1899-12-01')
+ ''',''' + ISNULL(GENDER,'')
+ ''',''' + ISNULL(MARITALSTATUS,'')
+ ''',''' + ISNULL(ADDRESS1,'')
+ ''',''' + ISNULL(ADDRESS2,'')
+ ''',' + ISNULL(str(ZIPKEY,4),'Null')
+ ',''' + ISNULL(HOMEPHONE,'')
+ ''',''' + ISNULL(WORKPHONE,'')
+ ''',''' + ISNULL(CELLPHONE,'')
+ ''',''' + ISNULL(STATUS,'')
+ ''',''' + ISNULL(EMAIL,'')
+ ''',''' + ISNULL(RELIGION,'')
+ ''',''' + ISNULL(NATIONALITY,'')
+ ''',''' + ISNULL(TITLE,'')
+ ''',''' + ISNULL(NICKNAME,'')
+ ''',''' + isnull(convert(varchar(10),HIREDDATE,126),'1899-12-01')
+ ''',''' + isnull(convert(varchar(10),EOCDATE,126),'1899-12-01')
+ ''',''' + ISNULL(POSITION,'')
+ ''',''' + ISNULL(LEVEL,'')
+ ''',' + ISNULL(str(VL,4),'Null')
+ ',' + ISNULL(str(SL,4),'Null')
+ ',' + ISNULL(str(USL,4),'Null')
+ ',''' + ISNULL(username,'')
+ ''',''' + ISNULL(password,'')
+ ''',' + ISNULL(str(DTREMPCODE,4),'Null')
+ ',''' + ISNULL(DTRLINKNAME,'')
+ ''',' + ISNULL(str(EMPSHIFTCODE,4),'Null')
+ ',''' + ISNULL(PICTURE,'')
+ ''',' + ISNULL(str(BASICMONTHLY,10,2),'Null')
+ ',' + ISNULL(str(BASICDAILY,10,2),'Null')
+ ',' + ISNULL(str(ALLOWANCE,10,2),'Null')
+ ',' + ISNULL(str(SSSCON,10,2),'Null')
+ ',' + ISNULL(str(PHCON,10,2),'Null')
+ ',' + ISNULL(str(HDMFCON,10,2),'Null')
+ ',''' + ISNULL(COMMENTS,'')
+ ''',' + ISNULL(str(GASALLOWANCE,10,2),'Null')
+ ',' + ISNULL(str(SSSDED,10,2),'Null')
+ ',' + ISNULL(str(PHDED,10,2),'Null')
+ ',' + ISNULL(str(HDMFDED,10,2),'Null')
+ ',' + ISNULL(str(CADED,10,2),'Null')
+ ',' + ISNULL(str(TAXDED,10,2),'Null')
+ ',' + ISNULL(str(SSSLOANDED,10,2),'Null')
+ ',' + ISNULL(str(HDMFLOANDED,10,2),'Null')
+ ',' + ISNULL(str(COMPANYLOANDED,10,2),'Null')
+ ',' + ISNULL(str(OTHERS,10,2),'Null')
+ ',''' + ISNULL(AUTOINCPAYROLL,'')
+ ''',''' + ISNULL(DEPARTMENT,'')
+ ''',''' + ISNULL(BRANCHNAME,'')
+ ''',''' + ISNULL(SUPERIOR,'')
+ ''',''' + ISNULL(ACCESSREGSYS,'') + ''')' from employee

